#业务类


import allure

from page.page_regForm import PageRegForm


class ServiceRegForm(object):
    def __init__(self,driver,base_url):
        #初始化和该业务有关的页面对象们
        self.page=PageRegForm(driver,base_url)



    def service_regForm_001(self,d):
        allure.attach("", "打开表单页面")
        self.page.openUrl()
        allure.attach("", f"输入账号:{d['zanhao']}")
        self.page.input_zanhao(d["zanhao"])
        self.page.input_pwd(d["pwd"])
        self.page.selectSex(d["sex"])
        self.page.selectGuoji(d["guoji"])
        self.page.selectAihao(d["aihao"])
        self.page.selectDegree(d["degree"])
        self.page.input_jiesao(d["jiesao"])
        self.page.uploadZaopian(d["zaopian"])
        self.page.input_birthday(d["birthday"])

        img=self.page.savePng3("注册表单",d["key"]) #"登录_K001_20250605100314"
        allure.attach(open(f'./screen/{img}.png',mode='rb').read(), "本次截图",allure.attachment_type.PNG)

        return True
